package com.lzy.crm.wechat.menu;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class InstantiationMenu implements ApplicationListener<ContextRefreshedEvent> {
	/**
	 *  LOG
	 */
	private Logger logger = Logger.getLogger(InstantiationMenu.class);
	
	@Resource(name="myMenu")
	private MyMenu myMenu;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		System.out.println("init menu~~");
		System.out.println(event.getApplicationContext().getParent());
		// 添加菜单 
		//if(event.getApplicationContext().getParent() == null){
			myMenu.createCommMenu();
			//logger.error("--------------------------onApplicationEvent------------");
		//}
	}
}
